﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace EasyLib.Extensions
{
    public static class FileExtension
    {
        /// <summary>
        /// 使用文件但是不用关心文件的关闭
        /// </summary>
        /// <param name="file"></param>
        /// <param name="path"></param>
        /// <param name="mode"></param>
        /// <param name="action"></param>
        public static void Open(this File file, string path, Action<FileStream> action)
        {

        }

        public static void Open(this File file, string path, FileMode mode, Action<FileStream> action)
        {

        }

        public static void Open(this File file, string path, FileMode mode, FileAccess access, Action<FileStream> action)
        {

        }

        public static void Open(this File file, string path, FileMode mode, FileAccess access, FileShare share, Action<FileStream> action)
        {

        }


        public static T Open<T>(this File file, string path, Func<FileStream, T> func)
        {
            throw new Exception();
        }

        public static T Open<T>(this File file, string path, FileMode mode, Func<FileStream, T> func)
        {
             throw new Exception();
        }

        public static T Open<T>(this File file, string path, FileMode mode, FileAccess access, Func<FileStream, T> func)
        {
             throw new Exception();
        }

        public static T Open<T>(this File file, string path, FileMode mode, FileAccess access, FileShare share, Func<FileStream, T> func)
        {
             throw new Exception();
        }
    }
}
